bin=http_server
cgi=test_cgi
txt=log.txt
curr=$(shell pwd)
cc=g++
LD_FLAGS=-std=c++11 -lpthread -static
src=main.cc

ALL:$(bin) $(cgi)
.PHONY:ALL

$(bin):$(src)
	$(cc) -o $@ $^ $(LD_FLAGS)

$(cgi):cgi/test_cgi.cc
	$(cc) -o $@ $^ 

.PHONY:clean
clean:
	rm -rf output
	rm -r $(bin) $(txt) $(cgi) 

.PHONY:output
output:
	mkdir -p output
	cp -rf wwwroot output
	cp $(bin) output
	cp $(cgi) output/wwwroot
	cp cgi/shell_cgi.sh  output/wwwroot
	cp cgi/python_cgi.py  output/wwwroot

